package models;

import android.content.Context;
import android.content.ContextWrapper;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;


public class Main_model {

	private String text;
	private final String shared_name = "PRES";
	private SharedPreferences pr;

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public Main_model get_datas(Context c) {
		pr = c.getSharedPreferences(shared_name, ContextWrapper.MODE_PRIVATE);
		this.setText(pr.getString("text", "Not exist"));
		return this;
	}

	public Main_model put_datas(Context c) {
		pr = c.getSharedPreferences(shared_name, ContextWrapper.MODE_PRIVATE);
		Editor editor = pr.edit();
		editor.putString("text", this.getText());
		editor.commit();
		return this;
	}
}
